package com.moguhoutai.biz;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.moguhoutai.dao.TypeMapper;
import com.moguhoutai.model.Type;
import com.moguhoutai.util.BusinessException;

@Service
public class TypeBiz {
    @Resource
	private TypeMapper tyMapperdao;
	
	public Type findById(int typeId)throws BusinessException{
		try {
			return tyMapperdao.selectByPrimaryKey(typeId);
		} catch (Exception e) {
			e.printStackTrace();
			throw new BusinessException("E07B05");
		}
		
	}
	
	public void save(Type type)throws BusinessException{
		try {
			tyMapperdao.insert(type);
		} catch (Exception e) {
			e.printStackTrace();
			throw new BusinessException("E07B01");
		}
		
	}
	
}
